
import 'package:courseapp/page/student/allcourse.dart';
import 'package:courseapp/page/student/signrecord.dart';
import 'package:flutter/material.dart';
import 'todaycourse.dart';

class StudentHome extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    // TODO: implement createState
    return new StudentState();
  }

}

class StudentState extends State<StudentHome> {
  int selectIndex = 0;

  Map map = {
   0 : new TodayCourseWidget(),
   1 : new AllCourseWidget(),
   2 : new SignRecordWidget()
  };

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
   return new Scaffold(
      body: map[selectIndex],
      bottomNavigationBar: Theme(data: ThemeData(highlightColor: Colors.transparent,splashColor: Colors.transparent),
      child: BottomNavigationBar(type: BottomNavigationBarType.fixed,
        unselectedFontSize: 10,
        selectedFontSize: 10,
        unselectedItemColor: Colors.grey,
        selectedItemColor: Colors.blue,
        currentIndex: selectIndex,
        items: [
        BottomNavigationBarItem(icon:Icon(Icons.school) ,title: Text("今日课程")),
        BottomNavigationBarItem(icon: Icon(Icons.dashboard), title: Text("全部课程")),
        BottomNavigationBarItem(icon:Icon(Icons.assignment_turned_in,),title: Text("签到记录")),
        ],
        onTap: (index){
          setState(() {
            selectIndex = index;
          });
        },
      ),
      ),
    );
  }


}
